﻿<Window x:Class="VoiceTestPlatform.ArtificialWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:l="clr-namespace:VoiceTestPlatform"
        Title="人工测试界面" Height="480" Width="640">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <!--菜单项-->
        <StackPanel Orientation="Horizontal">
            <StackPanel.Resources>
                <Style TargetType="Button">
                    <Setter Property="Width" Value="60" />
                    <Setter Property="Height" Value="60" />
                    <Setter Property="Margin" Value="5,5,0,5" />
                </Style>
            </StackPanel.Resources>

            <Button Command="{Binding StartRecordCommand}"  IsEnabled="{Binding IsStartEnable}">
                <TextBlock Width="50" TextWrapping="WrapWithOverflow" Margin="0" >
                    开始测试
                </TextBlock>
            </Button>
            <Button Command="{Binding StopRecordCommand}" IsEnabled="{Binding IsStopEnable}" >
                <TextBlock Width="50" TextWrapping="WrapWithOverflow" Margin="0">
                    结束测试
                </TextBlock>
            </Button>

            <StackPanel VerticalAlignment="Center" Visibility="Collapsed">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource menuTxt}">开始时间:</TextBlock>
                    <TextBlock Style="{StaticResource menuTxt}" Text="{Binding StartRecordTime}"/>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource menuTxt}">结束时间:</TextBlock>
                    <TextBlock Style="{StaticResource menuTxt}" Text="{Binding StopRecordTime}"/>
                </StackPanel>
            </StackPanel>

            <!--距离 角度 噪音背景 时间差-->
            <TextBlock Style="{StaticResource menuTxt}">距离:</TextBlock>
            <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ArDistanceText, Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>
            <TextBlock Style="{StaticResource menuTxt}">角度:</TextBlock>
            <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ArAngelText,Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>
            <TextBlock Style="{StaticResource menuTxt}">噪音背景:</TextBlock>
            <TextBox Style="{StaticResource menuTxtInput}" Text="{Binding ArNoiseText,Source={StaticResource  pm},UpdateSourceTrigger=PropertyChanged}"></TextBox>
        </StackPanel>
        <ListView Grid.Row="1" ItemsSource="{x:Static l:ResultManager.ArtificialResults}"  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                      ScrollViewer.VerticalScrollBarVisibility="Auto">
            <ListView.View>
                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="结果视图">
                    <GridViewColumn DisplayMemberBinding= "{Binding Path=TestDate}"   Header="时间" Width="100"/>

                    <GridViewColumn DisplayMemberBinding="{Binding Path=Recognition}"  Header="识别" Width="100" />

                    <!--<GridViewColumn DisplayMemberBinding="{Binding Path=AudioCommand}"  Header="音频命令" Width="100"/>-->
                    <!--<GridViewColumn DisplayMemberBinding="{Binding Path=Audio}"  Header="相关音频" Width="100"/>-->
                    <GridViewColumn DisplayMemberBinding="{Binding Path=BackSound}"  Header="背景录音" Width="100"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Path=DistanceText}"  Header="距离" Width="100"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Path=AngelText}"  Header="角度" Width="100"/>
                    <GridViewColumn DisplayMemberBinding="{Binding Path=NoiseText}"  Header="噪音背景" Width="100"/>
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Orientation="Horizontal" Grid.Row="2">
            <Button Style="{StaticResource FooterButton}" Command="{Binding ResultToExcelCommand}">导出Excel</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Command="{Binding SavePortMsgCommand}">保存所有原消息</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Command="{Binding ClearResultCommand}">清除结果</Button>
            <Button Style="{StaticResource FooterButton}" Width="100" Visibility="Collapsed" Click="AddResutl_Click" >模拟增加结果</Button>
            <!--<TextBlock Text="说明：环境参数在主界面设置" VerticalAlignment="Center" FontSize="13" Foreground="Red" Margin="20,0,0,0"/>-->
        </StackPanel>
    </Grid>
</Window>
